package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.math.BigInteger;

/**
 * @Author wpj
 * @Date 2020/9/2
 */
@FieldTypeAnnotation(tableName = "t_u_rank_value")
public class UserRankValue extends DataObject {
    @FieldTypeAnnotation(select = true, update = true)
    long userId;

    @FieldTypeAnnotation(update = true)
    int type;

    @FieldTypeAnnotation(update = true)
    int childType;

    @FieldTypeAnnotation(desc = "值")
    BigInteger value = BigInteger.ZERO;

    @FieldTypeAnnotation(desc = "时间")
    long time;

    @FieldTypeAnnotation(desc = "参数")
    String param = "";


    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }

    public void setType(int type) {
        if (this.type != type) {
            this.type = type;
            setOp(DataStatus.Update);
        }

    }

    public void setChildType(int childType) {
        if (this.childType != childType) {
            this.childType = childType;
            setOp(DataStatus.Update);
        }

    }

    public void setValue(BigInteger value) {
        if (null == value) {
            return;
        }
        if (!this.value.equals(value)) {
            this.value = value;
            setOp(DataStatus.Update);
        }
    }

    public void setTime(long time) {
        if (this.time != time) {
            this.time = time;
            setOp(DataStatus.Update);
        }

    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        if (param == null) {
            return;
        }
        if (!this.param.equals(param)) {
            this.param = param;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public int getType() {
        return type;
    }

    public int getChildType() {
        return childType;
    }

    public BigInteger getValue() {
        return value;
    }

    public long getTime() {
        return time;
    }


}
